<?php 
	session_start();
	if(!isset($_SESSION['userid']) || $_SESSION['userlevel'] != 1){
		header("location:login.php");
		exit();
	}
	require("../libraries/config.php");
	require("../libraries/database.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Adminstrator manage</title>
<link type="text/css" rel="stylesheet" href="styles/style.css" />
</head>

<body>
<div id="wrapper">
	<div id="header">
    	<div id="logo">
            <a href="index.php"><img src="images/logo.png" alt=""  /></a>
        </div>
    	<div id="menutop">        	
        	<ul>
            	<li>Xin chào</li>
                <li><?php echo $_SESSION['username']; ?></li>
                <li style="border:none"><a href="logout.php">Thoát</a></li>
            </ul>
        </div>
    </div>
    <div id="content">
    	<div id="conleft">
        	<h3>Quick menu</h3>
            <ul>
            	<li><a href="#">Thành viên</a>
                	<ul>
                    	<li><a href="index.php?page=users&act=list">Danh sách</a></li>
                        <li><a href="index.php?page=users&act=add">Thêm mới</a></li>
                    </ul>
                </li>
                <li><a href="#">Chuyên mục</a>
                	<ul>
                    	<li><a href="index.php?page=cate">Danh sách</a></li>
                        <li><a href="#">Thêm mới</a></li>
                    </ul>
                </li>
                <li><a href="#">Sản phẩm</a>
                	<ul>
                    	<li><a href="index.php?page=product">Danh sách</a></li>
                        <li><a href="#">Thêm mới</a></li>
                    </ul>
                </li>
                <li><a href="#">Tin tức</a></li>
            </ul>
        </div>
        <div id="conright">
        <?php
		if(isset($_GET['page'])){
			switch($_GET['page']){
				case "users" : require("modules/users/controller.php"); break;
			}
		}else{
			require("home.php");
		}
		?>
        </div>
    </div>
    <div id="footer"></div>
</div>
</body>
</html>